package demo;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class HelloWorld {
    public static void main(String[] args) throws Exception {
        FileOutputStream fos = new FileOutputStream("fos.dat");
        String line = "我爱你宝贝哈哈哈哈";
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        line = "我是分支上的我爱你宝贝啊哈哈啊哈";
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        line = "主线上新添加了一句话，我可太棒了！！！";
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        line = "我在分支上面又添加了一句很牛的话";
        fos.write(line.getBytes(StandardCharsets.UTF_8));
        System.out.println("写出完毕");
        fos.close();
    }
}
